import request from '@/utils/request'

// 查询附件管理列表
export function listAttachment(query) {
  return request({
    url: '/enterprise/attachment/list',
    method: 'get',
    params: query
  })
}

// 查询附件管理列表（按照业务主键、上传控件标识查询）
export function listByBusinessKeyAndUploaderId(businessId, uploaderId) {
  return request({
    url: '/enterprise/attachment/listByBusinessIdAndUploaderId?businessId=' + businessId + '&uploaderId=' + uploaderId,
    method: 'get'
  })
}

// 查询附件管理详细
export function getAttachment(id) {
  return request({
    url: '/enterprise/attachment/' + id,
    method: 'get'
  })
}

// 新增附件管理
export function addAttachment(data) {
  return request({
    url: '/enterprise/attachment',
    method: 'post',
    data: data
  })
}

// 修改附件管理
export function updateAttachment(data) {
  return request({
    url: '/enterprise/attachment',
    method: 'put',
    data: data
  })
}

// 删除附件管理
export function delAttachment(id) {
  return request({
    url: '/enterprise/attachment/' + id,
    method: 'delete'
  })
}

// 导出附件管理
export function exportAttachment(query) {
  return request({
    url: '/enterprise/attachment/export',
    method: 'get',
    params: query
  })
}
